using NodeCanvas.Framework;
using ParadoxNotion.Design;

namespace Yoozoo.Gameplay.City.AI.Node
{
    [Category("Ggame/City")]
    public class SetAnimatorTrigger : AIBaseNode
    {
        [RequiredField]
        public BBParameter<string> triggerName;
        public BBParameter<bool> triggerValue = true;
        
        protected override void OnExecute()
        {
            if (triggerValue.value) {
                _animator.SetTrigger(triggerName.value);
            }
            else {
                _animator.ResetTrigger(triggerName.value);
            }
            
            EndAction(true);
        }
        
    }
}